// key
const TOKEN_KEY = 'token'
Storage.prototype.setToken = (obj) => {
    if (obj) {
        localStorage.setItem(TOKEN_KEY, JSON.stringify(obj))
    }
}

Storage.prototype.getToken = () => {
    const item = localStorage.getItem(TOKEN_KEY);
    return JSON.parse(item);
}

Storage.prototype.getAccessToken = () => {
    const token = localStorage.getToken();
    if (token) {
        return token.access_token;
    }
    return undefined;
}


Storage.prototype.cleanToken = () => {
    localStorage.removeItem(TOKEN_KEY)
}
